package com.cwx.mychat.aspect;

/**
 * 作者： cwx
 * 时间： 2024/12/3 17:35
 * 版本： 1.0
 * 注释：
 */
import com.cwx.mychat.entity.po.ChatMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import java.util.HashMap;

@Component
public class MyRunner implements CommandLineRunner {

    @Autowired
    private MyService myService;

    @Override
    public void run(String... args) {

        HashMap<String, Object> map = new HashMap<>();
        map.put("key", "value");
        map.put("name", "张飒");

        ChatMessage chatMessage = new ChatMessage();
        chatMessage.setMessageContent("你好，我是张飒");
        myService.performTask(map, chatMessage); // 触发主线程任务
    }
}
